﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace MyTcpIp.configuration
{
    /// <summary>
    /// 通道配置
    /// </summary>
    /// 
    [StructLayoutAttribute(LayoutKind.Sequential, Pack = 4)]
    public struct ChannelConfig
    {
        /// <summary>
        /// 通道使能
        /// </summary>
        /// gai
        public byte enable;

        /// <summary>
        /// 通道ID 值从1开始                
        /// </summary>
        public UInt16 ChannelId;

        /// <summary>
        /// 转速编号
        /// </summary>
        /// gai
        public byte SpeedNum;
        
        /// <summary>
        /// 通道名称        
        /// </summary>
        /// gai
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
        public char[] ChannelName;

        /// <summary>
        /// 安装角度        
        /// </summary>
        public float InstallationAngle;

        /// <summary>
        /// 传感器类型 0：位移，1：速度，2：加速度 xxxxx
        /// </summary>                                                           										
        public UInt16 SensorType;

        /// <summary>
        /// 灵敏度系数 
        /// </summary>
        public float Sensitivity;

        /// <summary>
        /// 偏移量 
        /// </summary>
        public float OffsetValue;

        /// <summary>
        /// 矫正系数       
        /// </summary>
        public float Linearity;

        /// <summary>
        /// 零点偏移       
        /// </summary>                                     
        public float ZeroOffset;                                          
        /// <summary>
        /// 可选频段1
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
        public char[] Band1;

        /// <summary>
        /// 可选频段1上限
        /// </summary>
        public float ULimit1;

        /// <summary>
        /// 可选频段1下限
        /// </summary>
        public float LLimit1;

        /// <summary>
        /// 可选频段2
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
        public char[] Band2;

        /// <summary>
        /// 可选频段2上限
        /// </summary>
        public float ULimit2;
        //      xxxxx
        /// <summary>
        /// 可选频段2下限
        /// </summary>
        public float LLimit2;

        /// <summary>
        /// 可选频段3
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
        public char[] Band3;

        //     xxxxx
        /// <summary>
        /// 可选频段3上限
        /// </summary>
        public float ULimit3;

        /// <summary>
        /// 可选频段3下限
        /// </summary>
        public float LLimit3;

        /// <summary>
        /// 可选频段1黄色报警值
        /// </summary>
        public float Band1YellowValue;

        /// <summary>
        /// 可选频段1红色报警值
        /// </summary>
        public float Band1RedValue;

        /// <summary>
        /// 可选频段1报警值是否启用 0：不启用，1：启用    xxxxx
        /// </summary>
        public UInt16 Band1IsUser;

        /// <summary>
        /// 可选频段2黄色报警值
        /// </summary>
        public float Band2YellowValue;

        /// <summary>
        /// 可选频段2红色报警值
        /// </summary>
        public float Band2RedValue;

        /// <summary>
        /// 可选频段2报警值是否启用 0：不启用，1：启用   xxxxx
        /// </summary>
        public UInt16 Band2IsUser;
        /// <summary>
        /// 可选频段3黄色报警值
        /// </summary>
        public float Band3YellowValue;

        /// <summary>
        /// 可选频段3红色报警值
        /// </summary>
        public float Band3RedValue;

        /// <summary>
        /// 可选频段3报警值是否启用 0：不启用，1：启用
        /// </summary>
        public UInt16 Band3IsUser;

        /// <summary>
        /// 半频幅值黄色报警值
        /// </summary>
        public float HalfAmplitudeYellowValue;

        /// <summary>
        /// 半频幅值红色报警值
        /// </summary>
        public float HalfAmplitudeRedValue;

        /// <summary>
        /// 半频幅值报警值是否启用 0：不启用，1：启用   xxxxx
        /// </summary>
        public UInt16 HalfAmplitudeIsUser;
        /// <summary>
        /// 一倍频幅值黄色报警值
        /// </summary>
        public float OneAmplitudeYellowValue;
        //     xxxxx
        /// <summary>
        /// 一倍频幅值红色报警值
        /// </summary>
        public float OneAmplitudeRedValue;
        //        xxxxx
        /// <summary>
        /// 一倍频幅值报警值是否启用 0：不启用，1：启用   xxxxx
        /// </summary>
        public UInt16 OneAmplitudeIsUser;
        /// <summary>
        /// 通频值黄色报警值
        /// </summary>
        public float PassAmplitudeYellowValue;
        /// <summary>
        /// 通频值红色报警值
        /// </summary>
        public float PassAmplitudeRedValue;
        /// <summary>
        /// 通频值报警值是否启用 0：不启用，1：启用
        /// </summary>
        public UInt16 PassAmplitudeIsUser;
        //   xxxxx
        /// <summary>
        /// 二倍频幅值黄色报警值
        /// </summary>
        public float TwoAmplitudeYellowValue;
        /// <summary>
        /// 二倍频幅值红色报警值
        /// </summary>
        public float TwoAmplitudeRedValue;
        /// <summary>
        ///二倍频幅值报警值是否启用	0：不启用，1：启用
        /// </summary>     
        public UInt16 TwoAmplitudeIsUser;

        /// <summary>
        /// 加速度高频端
        /// </summary>
        public float AccHighAmplitudeYellowValue;

        public float AccHighAmplitudeRedValue;

        public UInt16 AccHighAmplitudeIsUser;

        /// <summary>
        /// 加速度低频段
        /// </summary>
        public float AccLowAmplitudeYellowValue;

        public float AccLowAmplitudeRedValue;

        public UInt16 AccLowAmplitudeIsUser;

        /// <summary>
        /// 加速度全频段
        /// </summary>
        public float AccTotalAmplitudeYellowValue;

        public float AccTotalAmplitudeRedValue;

        public UInt16 AccTotalAmplitudeIsUser;
    }
}
